/**************************************************************************
Copyright (C) jianbo miao Corporation.  All Rights Released.
this is a 3d engin named our_3d_engin.
our_3d_engin feature:
1:there is no float.
2:it do the 3d things all by softwear.
3:base on 1 and 2 , it can execution on arm which have no 3d hardwear accelerate.

  if you have any  suggestion or question,pls contact with me
  mail:miaojb@126.com
  msn:miaojianbo@hotmail.com
  qq:30209027
  
    2008/01/01
***************************************************************************/
//#ifndef OUR_MAIN_C
#define OUR_MAIN_C 



#include "our_math.h"
#include "our_main.h"
#include "our_3d.h"
#include "our_cpu.h"
#include "our_draw16.h"
#include "our_draw32.h"
#include "our_bmp.h"
#include "math.h"
//include c

#if 1
#include "our_math.c"
#include "our_3d.c"
#include "our_draw16.c"
#include "our_draw32.c"
#include "our_module.c"
#include "our_font.c"

#include "desk.c"
#include "6ca.c"
#include "6cm.c"
#include "6ex.c"
#include "6fg.c"

#include "6fm.c"
#include "6gp.c"
#include "6ie.c"
#include "6mg.c"

#include "6mm.c"
#include "6pb.c"
#include "6sc.c"
#include "6st.c"
#include "5bd.c"
#include "opt.c"
#include "opt1.c"
#include "opt2.c"
 
#endif
//----------------------------------
#define OUR_MF      1 

#define SCAN      (1<<(SCALE_1) ) 
#define MF_R      500  
//#define MF_D      2500  

//#define MOVE_STEP_NUM      625
//#define MOVE_STEP      625

 
//#define STEP_JD   10  
//FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
//FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF

OUR_GLOBAL	global;
//==============================================
OUR_BMP_INFO* BMP_IFO[25];
//OUR_BMP_INFO* BMP_IFO[22];

int frame=10000;
OUR_3D_LIT_PTR lit_list=0;
static int first=1;

static int x2[6];
static int x=-128<<8,y=0,z=00;
static int xin=00,yin=00,zin=00;


enum    
{
   OUR_MMI_TOP,
   OUR_MMI_SUB,
   OUR_MMI_OPT,
};
//int statud=TOP;
#define SUP_STATE_NUM 12
#define OPT_BACK_CLR 0x202f
typedef struct 
{
    short top_state;
    short opt_state;
    short opt_select;
    short opt_select_max;
    short sub_state_raw;
    short sub_state_line;
}OUR_3D_MMI_STATE;



OUR_3D_MMI_STATE mmi_state;
int OUR_THIRD_mmi(UCHAR *video_buffer, int key, int FPS);

void OUR_OJB_STATE_INIT()
{

    //cube obj
    x=-128<<8;
    y=0;
    z=00;
    xin=00;
    yin=00;
    zin=00;

    
    //============================================= 
    mmi_state.opt_select=0;    
    mmi_state.opt_select_max=19;
    mmi_state.opt_state=0;
    mmi_state.sub_state_line=3;
    mmi_state.sub_state_raw=0;
    mmi_state.top_state=OUR_MMI_TOP;
    //============================================= 
}


int OUR_3D_Init(void)
{
    int i=0;
    FIX_POINT3D lit_position={0,0,-2000};

    OUR_OJB_STATE_INIT();

    
    if(!first)
    {
        return 1;
    }

    first=0;
    //=============================================
    OUR_3Dengin_start();	//do at the first
    //=============================================
    global.cam_work.pos.MM.x=0;
    global.cam_work.pos.MM.y=-0000;
    global.cam_work.pos.MM.z=-6000;
    global.cam_work.target.MM.x=0;
    global.cam_work.target.MM.y=0000;
    global.cam_work.target.MM.z=000;
    global.cam_work.width=LCD_W/2;
    global.cam_work.hight=LCD_H/2;///(THREE_NUM+1);
    global.cam_work.focus=1130 *LCD_W/400;    
    //global.cam_work.focus=530 *LCD_W/400;    
    OUR_Build_CAM_Rotation_MATRIX3X3(&global.cam_work);//1550t
    //=============================================
    global.cam_work2.pos.MM.x=0;
    global.cam_work2.pos.MM.y=-0000;
    global.cam_work2.pos.MM.z=4000;
    global.cam_work2.target.MM.x=0;
    global.cam_work2.target.MM.y=0000;
    global.cam_work2.target.MM.z=000;
    global.cam_work2.width=LCD_W/2;
    global.cam_work2.hight=(LCD_H)/16;///(THREE_NUM+1);
    global.cam_work2.focus=400 *LCD_W/400;    
    //global.cam_work2.focus=300 *LCD_W/400;   
    OUR_Build_CAM_Rotation_MATRIX3X3(&global.cam_work2);//1550t
    //=============================================   
    i=0;
    BMP_IFO[i]=&BMP_IFO_bd;//up boarder
    i++;
    BMP_IFO[i]=&BMP_IFO_bd;//up boarder
    i++;
    BMP_IFO[i]=&BMP_IFO_bd;//butt boarder
    i++;
    BMP_IFO[i]=&BMP_IFO_bd;//3//butt boarder
    i++;

    BMP_IFO[i]=&BMP_IFO_6pb;// 0
    i++;
    BMP_IFO[i]=&BMP_IFO_6ca;// 
    i++;
    BMP_IFO[i]=&BMP_IFO_6st;//
    i++;
    BMP_IFO[i]=&BMP_IFO_6fg;// 3
    
    i++;
    BMP_IFO[i]=&BMP_IFO_6mg;// 4
    i++;
    BMP_IFO[i]=&BMP_IFO_6mm;
    i++;
    BMP_IFO[i]=&BMP_IFO_6ie;
    i++;
    BMP_IFO[i]=&BMP_IFO_6cm;
    
    i++;
    BMP_IFO[i]=&BMP_IFO_6fm;//8
    i++;
    BMP_IFO[i]=&BMP_IFO_6sc;
    i++;
    BMP_IFO[i]=&BMP_IFO_6gp;
    i++;    
    BMP_IFO[i]=&BMP_IFO_6ex;
    i++;
    
    

    BMP_IFO[i]=&BMP_IFO_bd;
    i++;
    BMP_IFO[i]=&BMP_IFO_bd;
    i++;
    BMP_IFO[i]=&BMP_IFO_bd;
    i++;
    BMP_IFO[i]=&BMP_IFO_bd;//19
    i++;

    BMP_IFO[i]=&BMP_IFO_opt;//20
    i++;
    BMP_IFO[i]=&BMP_IFO_desk;//21BMP_IFO_opt;//
    i++;
    
    BMP_IFO[i]=&BMP_IFO_opt1;//22
    i++;
    BMP_IFO[i]=&BMP_IFO_opt2;//23
    i++;
    BMP_IFO[i]=&BMP_IFO_opt2;//24
    i++;

    //========================================
    for(i=0;i<20;i++)
    {
     //   BMP_IFO[i]=&BMP_IFO_bmp0;
    }
    //=============================================

    //=============================================
    global.point_obj_pos.MM.x=0;
    global.point_obj_pos.MM.y=0;//MF_D*(THREE_NUM-1)/2 -MF_D*i;
    global.point_obj_pos.MM.z=0;
    //=============================================

    OUR_OBJ_INIT32(&global.obj,
        //MATERIAL_Triangle_T,
        //MATERIAL_wire,
        //MATERIAL_point_1,//+MATERIAL_cmp_z,
        MATERIAL_bmp,//+MATERIAL_pre_z,
        //MATERIAL_Triangle_1,//+MATERIAL_cmp_z,
        &global.point_obj_pos,
        SCAN,
        P_NUM,T_NUM,
        //32,64,
        global.point_org1,
        global.point_nor1,
        global.point_work1,
        global.triangle_work1,
        OUR_RGB32(255,255,255),
        global.clr_work1,
        BMP_IFO,
        global.point_do1,
        global.Triangle_do1		
        );
    //=============================================


    OUR_OBJ_INIT32(&global.obj2,
        //MATERIAL_Triangle_T,
        //MATERIAL_point_1P,
        //MATERIAL_point_1,//+MATERIAL_cmp_z,
        MATERIAL_bmp,//+MATERIAL_pre_z,
        //MATERIAL_Triangle_1,//+MATERIAL_cmp_z,
        &global.point_obj_pos,
        SCAN,
        P_NUM2,T_NUM2,
        //32,64,
        global.point_org2,
        global.point_nor2,
        global.point_work2,
        global.triangle_work2,
        OUR_RGB32(255,255,255),
        global.clr_work2,
        &BMP_IFO[22],
        global.point_do2,
        global.Triangle_do2		
        );

    //=============================================
    OUR_creat_three(&global.obj2);
    OUR_creat_ball_cube(&global.obj,MF_R);
    //OUR_creat_M(&global.obj,MF_R);
    //OUR_creat_square_mg(&global.obj,MF_R);
    //OUR_creat_cube(&global.obj,MF_R);
    OUR_INIT_Triangle_Normal(&global.obj);	
    //OUR_INIT_Point_Normal(&global.obj);
    OUR_INIT_Triangle_Normal(&global.obj2);	
    //OUR_INIT_Point_Normal(&global.obj);
    //============================================= 

   // OUR_LIT_INIT32(&global.point_lit,0,
     //                       CLR clr, UINT sta)global.point_lit
#define LIT_C 200
	OUR_LIT_INIT32(	&global.point_lit,
					&lit_position,
					OUR_RGB32(LIT_C,LIT_C,LIT_C),
					//LIT_condition
					LIT_point
					);
	OUR_LIT_INSERT(&lit_list,&global.point_lit);

    //============================================= 

    
    return(1);
    
} // end Game_Init

//================================================================

#define KEY_STEP_NUM 6  
#define KEY_STEP_TO_ALL (1<<15)   
#define KEY_STEP (KEY_STEP_TO_ALL/KEY_STEP_NUM)
int OUR_3D_Main(UCHAR *video_buffer, int key, int FPS)
{
    //QueryPerformanceCounter(&lpPerformanceCount1);
    
    int i=13,j=0,temp;
    int scal=SCAN;
    int buff_start=0;
//    static int x=-128<<8,y=0,z=00;
    //static int x2=0,y2=0,z2=00;
//    static int xin=00,yin=00,zin=00;
    char work_string[50]; // temp string
    int a[5];
    FIX_POINT3D n;

    static int KEY_STEP_y=(KEY_STEP_TO_ALL/KEY_STEP_NUM)  ;
    //while(1)
    {
        //-----------------------------
        OUR_new_frame_start();
        //------------------------
       
        //=================================================================================================	
#define KEY_TIME 40
        if(key==97)//in
        {
            if(OUR_MMI_TOP==mmi_state.top_state)
            {
                mmi_state.top_state=OUR_MMI_SUB;
                z=0;
                x=-128<<8;
                
                if(1==(mmi_state.sub_state_line>>1))
                {
                    KEY_STEP_y=KEY_STEP;
                    yin-=KEY_STEP_NUM;
                }
                if(2==(mmi_state.sub_state_line>>1))
                {
                    KEY_STEP_y=2*KEY_STEP;
                    yin-=KEY_STEP_NUM;
                }
                if(3==(mmi_state.sub_state_line>>1))
                {
                    KEY_STEP_y=KEY_STEP;
                    yin+=KEY_STEP_NUM;
                }
                
                xin-=KEY_STEP_NUM;
            }

            else if(OUR_MMI_SUB==mmi_state.top_state)
            {
                mmi_state.top_state=OUR_MMI_OPT;
                //--------------------------------
                for(i=1;i<6;i++)
                {
                    x2[i]=0;
                }
                x2[0]=170;
                mmi_state.opt_select=0;
                //--------------------------------
                z=0;
                x=0;
                //y=0;
                y+=(0x1<<20);
                y=y&(0x1ffff);
                //if(y==0){}
                if(1==(mmi_state.sub_state_line>>1))
                {
                    KEY_STEP_y=KEY_STEP;
                    yin+=KEY_STEP_NUM;                    
                }
                else if(2==(mmi_state.sub_state_line>>1))
                {
                    KEY_STEP_y=2*KEY_STEP;
                    yin-=KEY_STEP_NUM;
                }
                else if(3==(mmi_state.sub_state_line>>1))
                {
                    KEY_STEP_y=KEY_STEP;
                    yin-=KEY_STEP_NUM;
                }
                xin-=KEY_STEP_NUM;
            }
        }

        else if(key==98)//out
        {
            if(OUR_MMI_OPT==mmi_state.top_state)
            {
                mmi_state.top_state=OUR_MMI_SUB;
                z=0;
                x=128<<8;
                y=0;
                if(1==(mmi_state.sub_state_line>>1))
                {
                    KEY_STEP_y=KEY_STEP;
                    yin-=KEY_STEP_NUM;
                }
                if(2==(mmi_state.sub_state_line>>1))
                {
                    KEY_STEP_y=2*KEY_STEP;
                    yin-=KEY_STEP_NUM;
                }
                if(3==(mmi_state.sub_state_line>>1))
                {
                    KEY_STEP_y=KEY_STEP;
                    yin+=KEY_STEP_NUM;
                }
                xin+=KEY_STEP_NUM;
            }
            else  if(OUR_MMI_SUB==mmi_state.top_state)
            {
                mmi_state.top_state=OUR_MMI_TOP;
                z=0;
                x=0;
                //y=0;
                y+=(0x1<<20);
                y=y&(0x1ffff);
                //if(y==0){}
                if(1==(mmi_state.sub_state_line>>1))
                {
                    
                    KEY_STEP_y=KEY_STEP;
                    yin+=KEY_STEP_NUM;                    
                }
                else if(2==(mmi_state.sub_state_line>>1))
                {
                    
                    KEY_STEP_y=2*KEY_STEP;
                    yin-=KEY_STEP_NUM;
                }
                else if(3==(mmi_state.sub_state_line>>1))
                {
                    KEY_STEP_y=KEY_STEP;
                    yin-=KEY_STEP_NUM;
                }
                xin+=KEY_STEP_NUM;
            }
        }
        //==============================================
        else if(key==39)//right
        {            
            if(OUR_MMI_SUB==mmi_state.top_state)
            {
                //OUR_draw_bmp_SB(&global.obj, video_buffer, LCD_W);
            
                mmi_state.sub_state_line+=1;
                if(mmi_state.sub_state_line>=8)
                {
                    mmi_state.sub_state_line=0;
                }
                if(!(mmi_state.sub_state_line &1))
                {
                    KEY_STEP_y=KEY_STEP;
                    mmi_state.sub_state_line+=1;
                    if(yin<0)
                    {
                        y+=128<<8;
                    }
                    else
                    {
                        y=(((mmi_state.sub_state_line>>1))*128-128)<<8;
                        yin=-KEY_STEP_NUM;
                    }
                }
                //return 1;
            }
        }
        else if(key==37)//left
        {
            if(OUR_MMI_SUB==mmi_state.top_state)
            {
                mmi_state.sub_state_line-=1;
                if(mmi_state.sub_state_line<0)
                {
                    mmi_state.sub_state_line=7;
                }
                if((mmi_state.sub_state_line &1))
                { 
                    mmi_state.sub_state_line-=1;
                    KEY_STEP_y=KEY_STEP;
                    if(yin>0)
                    {
                        y-=128<<8;
                    }
                    else
                    {
                        y=(((mmi_state.sub_state_line>>1))*128+128)<<8;
                        yin=KEY_STEP_NUM;
                    }
                }
            }
        }
        else if(key==38)//up
        {
            if(OUR_MMI_SUB==mmi_state.top_state)
            {
                mmi_state.sub_state_raw-=1;
                if(mmi_state.sub_state_raw<0)
                {
                    mmi_state.sub_state_raw=2;
                }
            }
            else if(OUR_MMI_OPT==mmi_state.top_state)
            {                       
               // return OUR_THIRD_mmi(video_buffer,38,0);
            }
        }
        else if(key==40)//down
        {
            if(OUR_MMI_SUB==mmi_state.top_state)
            {
                mmi_state.sub_state_raw+=1;
                if(mmi_state.sub_state_raw>2)
                {
                    mmi_state.sub_state_raw=0;
                }
            }
            else if(OUR_MMI_OPT==mmi_state.top_state)
            {                       
              //  return OUR_THIRD_mmi(video_buffer,40,0);
            }
        }
        //------------------------
        //just change the xyz
        if(xin>0)//90
        {
            xin--; x-=KEY_STEP;
        }
        else if(xin<0)//90
        {
            xin++; x+=KEY_STEP;
        }
        else
        {
            x+=0x3fff; x&=~0x7fff;
        }
        if(yin>0)//90
        {
            yin--;  y-=KEY_STEP_y;
        }
        else if(yin<0)//90
        {
            yin++;  y+=KEY_STEP_y;
        }
        else
        {
            y+=0x3fff;y&=~0x7fff;
        }
        if(zin>0)//90
        {
            zin--;  z-=KEY_STEP;
        }
        else if(zin<0)//90
        {
            zin++;  z+=KEY_STEP;
        }
        else
        {
            z+=0x3fff; z&=~0x7fff;
        }
        //=================================================================================================       
        if((!(xin|yin|zin)))// || (yin==KEY_STEP_NUM)|| (yin==-KEY_STEP_NUM))
        {
#if 1
            if(OUR_MMI_TOP==mmi_state.top_state)
            {/**/
                OUR_Draw_bmp16_SBLT( 0,0,LCD_W,LCD_H,
                                    1,1,255,399,
                                    video_buffer, LCD_W,
                                    BMP_IFO[21]);
                /*           
                a[0]=x; a[1]=y;   a[2]=mmi_state.sub_state_line;
                OUR_sprintf(work_string,"%x %x %x", a);	 
                OUR_Draw_Text16(00,5,OUR_RGB16(255,255,255),work_string,video_buffer, LCD_W*2);*/ 
                return yin;
            }
            else if(OUR_MMI_OPT==mmi_state.top_state)
            {          
                if( mmi_state.opt_state==0)
                {
                    mmi_state.opt_state=1;
                    return OUR_THIRD_mmi(video_buffer,97,0);
                }
                return OUR_THIRD_mmi(video_buffer,key,0);              
            }
            else if(OUR_MMI_SUB==mmi_state.top_state)
            {
                mmi_state.opt_state=0;
                OUR_draw_bmp_SB(&global.obj, video_buffer, LCD_W);
                /*
                a[0]=FPS; a[1]=y;a[2]=mmi_state.sub_state_line;
                OUR_sprintf(work_string,"%x %x %x", a);	
                OUR_Draw_Text16(00,5,OUR_RGB16(255,255,255),work_string,video_buffer, LCD_W*2);*/
                return yin;/**/
            }

#endif
    }
        OUR_3Dengin_SET_LCD_B(LCD_W,LCD_H);
        if(x)//pull the cam farer
        {
            global.cam_work.pos.MM.z=-8000-(790*OUR_Fast_Sin((x>>8)&0xff)>>15)-(10000*OUR_Fast_Sin((x>>7)&0xff)>>15);
            scal=SCAN+(SCAN*160/240 *OUR_Fast_Sin((x>>8)&0xff)>>15);
            OUR_OBJ_SET_SCALE_Y(&global.obj,scal);
            
            OUR_BOX_OUT_clear16(80,140,
                        OPT_BACK_CLR,
                        video_buffer, LCD_W
                        );  
        }
        else
        {
            OUR_OBJ_SET_SCALE_Y(&global.obj,SCAN-(1<<7));
            global.cam_work.pos.MM.z=-8000-(2000*OUR_Fast_Sin((y>>7)&0xff)>>15);
            
            OUR_BOX_OUT_clear16(25,80,
                        OPT_BACK_CLR,
                        video_buffer, LCD_W
                        );  /**/
        }
        global.cam_work.pos.MM.x=0;
        global.cam_work.pos.MM.y=0;
        
        //OUR_Build_CAM_Rotation_MATRIX3X3(&global.cam_work);//1550t
        //--------------------------------------------------------------------
        //global.cam_work2.pos.MM.x=0;
        //global.cam_work2.pos.MM.y=0;
        //global.cam_work2.pos.MM.z=-10000;
        
        //OUR_Build_CAM_Rotation_MATRIX3X3(&global.cam_work2);//1550t
        
        //=================================================================================================
        //========obj 1  ========================================================================
     
       //  if((xin|yin|zin))      
         {
            OUR_XYZ_Rotation_OBJ(x>>8, y>>8, z>>8,&global.obj,OBJ_R_XYZ); 	
            
            OUR_BACHFACE_OBJ_LIT32(&global.obj,&global.cam_work,lit_list);
            
            OUR_POINT_CHANGE_OBJ(&global.obj,&global.cam_work);
            OUR_Draw_OBJ( &global.obj, video_buffer, LCD_W,CLOR_MOD);      
         }

        //=================================================================================================
        //========== ===================================================================================
#if 1
        if(2==mmi_state.sub_state_raw)
        {
            static UINT xxx=0;
            static UINT t=0;
            xxx++;
            if(xxx>200)     xxx=0;
    	      t++;
            OUR_Draw_bmp16_SBLT_T(xxx,xxx,LCD_W/2,LCD_W/2,
                                        1,1,62,62,
                                        (t/4)&0x1f,
                                        video_buffer, LCD_W,
                                        BMP_IFO[5]);
        }
        //=================================================================================================
        //=================================================================================================
        a[0]=FPS;a[1]=y;a[2]=mmi_state.sub_state_line;
        OUR_sprintf(work_string,"%x %x %x", a);	    
        //OUR_Draw_BigText32(00,580,OUR_RGB32(255,255,0),work_string,video_buffer, LCD_W*2);
        OUR_Draw_Text16(00,15,OUR_RGB16(255,255,255),work_string,video_buffer, LCD_W*2);
        
        OUR_sprintf(work_string,"OUR_3D_ENGINE", a);
        //OUR_Draw_BigText32(00,580,OUR_RGB32(0,255,255,0),work_string,video_buffer, LCD_W*2);
        OUR_Draw_Text16(00,LCD_H-10,OUR_RGB16(255,255,255),work_string,video_buffer, LCD_W*2);
        //================================================================
        //================================================================
    
#endif 
    } 
    return xin|yin|zin;

} // end Game_Main


const int bmp_inde[4][6]={
                                {0,1,4,5,8,9},
                                {1,2,5,6,9,10},
                                {2,3,6,7,10,11},
                                {3,0,7,4,11,8},
};

void OUR_draw_bmp_SB( OUR_3D_OBJ_PTR	obj,UCHAR *video_buffer, int lpitch)
{
        UINT i1=0,i2=0,i3=0;

        for (i2=0; i2 <3; i2++)
        { 
            for (i1=0; i1 <2; i1++)
            {
                OUR_Draw_bmp16_SBLT( i1*LCD_W/2,20*LCD_H/400+i2*120*LCD_H/400,LCD_W/2,120*LCD_H/400,
                                    1,1,62,62,
                                    video_buffer, LCD_W,
                                    BMP_IFO[bmp_inde[mmi_state.sub_state_line>>1][i2*2+i1]+4]);
            }
        } 
       // for (i1=0; i1 <2; i1++)
        {
            OUR_Draw_bmp16_SBLT(0,0,LCD_W,20*LCD_H/400,
                                1,1,31,15,
                                video_buffer, LCD_W,

                                BMP_IFO[(0)]);
        }
       // for (i1=0; i1 <2; i1++)
        {
            OUR_Draw_bmp16_SBLT( 0,LCD_H-20,LCD_W,20,
                                1,1,31,15,
                                video_buffer, LCD_W,
                                BMP_IFO[(0)]);
        }
       
        OUR_Draw_falsh_board16(((mmi_state.sub_state_line&1)*120),20+(mmi_state.sub_state_raw*120*LCD_H/400),120,120*LCD_H/400,10,
                                                OUR_RGB32(00,0,50),
                                                OUR_RGB32(050,255,150),
                                                video_buffer, LCD_W
                                                );/**/
        
        
}


void OUR_draw_bmp_OPT( OUR_3D_OBJ_PTR	obj,UCHAR *video_buffer, int lpitch)
{
    UINT i1=0,i2=0,i3=0;
    
    OUR_mmset_box16(0,0,240,320,video_buffer, LCD_W,OPT_BACK_CLR);
    i2=0;
    i3=mmi_state.opt_select;
    //OUR_mmset_box16(10,50+i2*40,220,5,video_buffer, LCD_W,OPT_BACK_CLR);
    while(i3>5)
    {
        i3-=6;
    }
    for (i2=0; i2 <6; i2++) 
    { 
        if (i2==i3)
        {
            OUR_Draw_bmp16_SBLT( 9*LCD_W/240,45+i2*40,221,35,
                                1,1,255,63,
                                video_buffer, LCD_W,
                                obj->bmp_info[0]);
        }
        else
        {
            OUR_Draw_bmp16_SBLT( 9*LCD_W/240,45+i2*40,221,35,
                                1,1,255,63,
                                video_buffer, LCD_W,
                                obj->bmp_info[1]);
        }
        //OUR_mmset_box16(10,96+i2*40,220,9,video_buffer, LCD_W,OPT_BACK_CLR);
    } 
    //OUR_mmset_box16(10,55+i2*40,220,5,video_buffer, LCD_W,OPT_BACK_CLR);

    OUR_Draw_bmp16_SBLT(0,0,LCD_W,40*LCD_W/240,
                        1,1,31,15,
                        video_buffer, LCD_W,

                        BMP_IFO[(0)]);
    OUR_Draw_bmp16_SBLT( 0,360*LCD_H/400+1,LCD_W,40*LCD_H/400-1,
                        1,1,31,15,
                        video_buffer, LCD_W,
                        BMP_IFO[(0)]);
}
      

void OUR_draw_bmp_OPT_MOVE( OUR_3D_OBJ_PTR	obj,int move_x,UCHAR *video_buffer, int lpitch)
{
    UINT i1=0,i2=0,i3=0;
    video_buffer+=(LCD_H)*(LCD_W)/4;
    i2=0;
    i3=mmi_state.opt_select;

    OUR_mmset_box16(move_x+215,5,26,241,video_buffer, LCD_W,OPT_BACK_CLR);
   //OUR_mmset_box16(0,0,240,300,video_buffer, LCD_W,OPT_BACK_CLR);
    for (i2=0; i2 <6; i2++)
    {
        {
            OUR_Draw_bmp16_SBLT( move_x,5+i2*40,221,35,
                                1,1,255,63,
                                video_buffer, LCD_W,
                                obj->bmp_info[1]);
            OUR_Draw_bmp16_SBLT( move_x+240,5+i2*40,221,35,
                                1,1,255,63,
                                video_buffer, LCD_W,
                                obj->bmp_info[1]);
        }
    } 

}


OUR_3D_MMI_STATE* OUR_3D_get_mmi_state(void)
{
    return &mmi_state;
}

int OUR_THIRD_mmi(UCHAR *video_buffer1, int key, int FPS)
{
    char work_string[50]; // temp string
    int a[5];
    int video_step;
   // UINT clr; 
    int i;
    static int start,end;
    int ret=0;
    static int key_old;


    UCHAR *video_buffer=video_buffer1;
    //==========================================================
    if(OUR_MMI_OPT==mmi_state.top_state)
    {
        if(key==38)//up
        {
            key_old=key;
            mmi_state.opt_select--;
            if(mmi_state.opt_select<0)
            {
                mmi_state.opt_select=mmi_state.opt_select_max-1;
                if(!((mmi_state.opt_select)%6))//turn to the last pag
                {
                    x2[0]=0;
                }
            }
        }    
        else if(key==40)//down
        {
            key_old=key;
            mmi_state.opt_select++;
            if(mmi_state.opt_select>mmi_state.opt_select_max-1)
            {
                mmi_state.opt_select=0;
                x2[0]=0;
            }        
        }   
        else if(key==37)//left
        {
            key_old=key;
            if(mmi_state.opt_select<6)
            {
                mmi_state.opt_select=mmi_state.opt_select_max/6*6+mmi_state.opt_select;
                if(mmi_state.opt_select>mmi_state.opt_select_max-1)
                {
                    mmi_state.opt_select=mmi_state.opt_select_max-1;
                }
            } 
            else
            {
                mmi_state.opt_select-=6;
            }
            for(i=0;i<6;i++)
            {
                x2[i]=0;
            }
            x2[mmi_state.opt_select%6]=170;
            end=0;
        }   
        else if(key==39)//right
        {
            key_old=key;
            if(mmi_state.opt_select>mmi_state.opt_select_max-7)
            {
                if((mmi_state.opt_select/6)==(mmi_state.opt_select_max/6))
                {
                    mmi_state.opt_select=mmi_state.opt_select%6;
                }
                else
                {
                    mmi_state.opt_select=mmi_state.opt_select_max-1;
                }
            } 
            else
            {
                mmi_state.opt_select+=6;
            }
            for(i=0;i<6;i++)
            {
                x2[i]=0;
            }
            x2[mmi_state.opt_select%6]=170;
            end=170+34;
        }
        else if(key==97)//in
        {
            key_old=key;
            //if((mmi_state.opt_select==0)&&(x2[0]==170))
            {
                OUR_draw_bmp_OPT(&global.obj2, video_buffer, LCD_W);
                /*
                a[0]=mmi_state.opt_select;a[1]=start;a[2]=end;
                OUR_sprintf(work_string,"sel=%x s=%x e=%x", a);	   
                OUR_Draw_Text16(0,15,OUR_RGB16(255,255,255),work_string,video_buffer1, LCD_W*2);*/    
                return 0;
            }
        }
    }
    else
    {
        return 0;
    }
    //========================================
    if(key_old==39)//the right key is pressed but the amo is not end
    {
        if(end>0)
        {
            end-=34;
            OUR_draw_bmp_OPT_MOVE(&global.obj2,-end, video_buffer1, LCD_W);
            /*
            a[0]=mmi_state.opt_select;a[1]=start;a[2]=end;
            OUR_sprintf(work_string,"sel=%x s=%x e=%x", a);	   
            OUR_Draw_Text16(0,15,OUR_RGB16(255,255,255),work_string,video_buffer1, LCD_W*2);*/    
            return 1;
        }
        else
        {
            key_old==0;
        }
    }

    if(key_old==37)
    {
        if(end<170+34)
        {
            end+=34;
            OUR_draw_bmp_OPT_MOVE(&global.obj2,-end, video_buffer1, LCD_W);
            /*
            a[0]=mmi_state.opt_select;a[1]=start;a[2]=end;
            OUR_sprintf(work_string,"sel=%x s=%x e=%x", a);	   
            OUR_Draw_Text16(0,15,OUR_RGB16(255,255,255),work_string,video_buffer1, LCD_W*2);  */  
            return 1;
        }
        else
        {
            key_old==0;
        }
    }
    //==========================================================
    //clr=OUR_RGB16BIT565(20, 20, 100);
    //clr=(clr<<16)+clr;
    video_step=global.cam_work2.hight*4*LCD_W;
    
    start=(mmi_state.opt_select/6)*6;
    end=mmi_state.opt_select_max-start;
    if(end>6)
    {
        end=6;
    }
    for(i=0;i<end;i++)
    {
        if((mmi_state.opt_select==start+i) )
        {
            if(x2[i]<170)
            {
                x2[i]+=34;
            }
        }
        else if(x2[i]>0)
        {  
            x2[i]-=34;  
        }
    }
    
    if(x2[0]>0&&x2[0]<170)
    {
        if(((key_old==40) &&( mmi_state.opt_select==start))//down
        ||((key_old==38) &&(( mmi_state.opt_select!=start)//up
           ||(mmi_state.opt_select==(mmi_state.opt_select_max-1)))))
        {
            OUR_draw_bmp_OPT_MOVE(&global.obj2,-x2[0], video_buffer1, LCD_W);
            /*
            a[0]=mmi_state.opt_select;a[1]=start;a[2]=end;
            OUR_sprintf(work_string,"sel=%x s=%x e=%x", a);	   
            OUR_Draw_Text16(0,15,OUR_RGB16(0,255,255,255),work_string,video_buffer1, LCD_W*2);*/    
            return 1;
        }
    }
    

    for(i=0;i<end;i++)
    {
        video_buffer+=video_step;
        if(x2[i]<=0 ||x2[i]>=170  )
        {
            continue;
        }                    
        ret++;
       // // OUR_mmset_box16(10,55+i2*50,220,5,video_buffer, LCD_W,clr);
       OUR_mmset((UINT*)(video_buffer),OPT_BACK_CLR+(OPT_BACK_CLR<<16),video_step/4);
        OUR_XYZ_Rotation_OBJ( x2[i],0, 0,&global.obj2,OBJ_R_XYZ); 	
        
        OUR_BACHFACE_OBJ_LIT32(&global.obj2,&global.cam_work2,lit_list);
        
        OUR_POINT_CHANGE_OBJ(&global.obj2,&global.cam_work2);
        /*OUR_BOX_OUT_clear16(18,20,
                        OPT_BACK_CLR,
                        video_buffer, LCD_W
                        );  */
        OUR_Draw_OBJ( &global.obj2, video_buffer, LCD_W,CLOR_MOD); 
    } 
    if(ret==0)
    {
        OUR_draw_bmp_OPT(&global.obj2, video_buffer1, LCD_W);
    } 
    /*
        a[0]=mmi_state.opt_select;a[1]=start;a[2]=end;
        OUR_sprintf(work_string,"sel=%x s=%x e=%x", a);	   
        OUR_Draw_Text16(0,15,OUR_RGB16(0,255,255,255),work_string,video_buffer1, LCD_W*2);*/    
    return ret;
}



//==================================================================================
//==============================================
///====by mjb =====================================================
//#define OUR_3D_ 1
#define OUR_3D_mmi_struct 0
#if OUR_3D_

//#include "GlobalMenuHandlers.h"

//#include "our_main.c"
/*


*/




#if OUR_3D_mmi_struct
typedef void (*OUR_3D_mmi_funptr)(void); 

typedef struct 
{
    U16 str_id;
    OUR_3D_mmi_funptr third_highlight_fun;
}THIRD_STRUCT;


typedef struct 
{
    U16 str_id;
    THIRD_STRUCT* third_menu;
}SECOND_STRUCT;


extern void highlight_mainmenu_profiles(void);
extern void HighlightLcddisplaySet(void);
extern void HighlightPhnsetTimeAndDate(void);
extern void HighlightPhnsetScr(void);
extern void HighlightManageCalls(void);

THIRD_STRUCT setting_child_3[]={
                                            {MAIN_MENU_PROFILES_TEXT,    HighlightManageCalls},//highlight_mainmenu_profiles
                                            {STR_DISPLAY_SETTING,           HighlightLcddisplaySet},
                                            {STR_MENU9141_TIME_AND_DATE, HighlightPhnsetTimeAndDate},
                                            {STR_MENU9141_TIME_AND_DATE,           HighlightPhnsetScr},//STRING_MTPNP_PHONE_SETTING
                                            {STR_MENU9100_CALL_SETTING,           HighlightManageCalls},
                                            {STR_MENU9166_AUTO_KEYPAD_LOCK,           HighlightLcddisplaySet},
                                            };


SECOND_STRUCT our_3d_mmi_2[]={
                                            {MAIN_MENU_BBK_SPACE_TEXT,              setting_child_3},//STR_SCR_CALL_HISTORY_MAIN_MENU_CAPTION
                                            {MAIN_MENU_BBK_SPACE_TEXT,                 setting_child_3},
                                            {MAIN_MENU_BBK_SPACE_TEXT,                 setting_child_3},
                                            {MAIN_MENU_WORK_STUDY_TEXT,                 setting_child_3},
                                            {MAIN_MENU_MY_OWN_TEXT,                 setting_child_3},
                                            {MENU_BBK_GAMES_SPACE_TEXT,                 setting_child_3},
                                            {MAIN_MENU_BBK_SPACE_TEXT,                 setting_child_3},
                                            {MAIN_MENU_BBK_SPACE_TEXT,                 setting_child_3},

                                            {MAIN_MENU_BBK_SPACE_TEXT,                 setting_child_3},
                                            {MAIN_MENU_BBK_SPACE_TEXT,                 setting_child_3},
                                            {MAIN_MENU_WORK_STUDY_TEXT,                 setting_child_3},
                                            {MAIN_MENU_MY_OWN_TEXT,                 setting_child_3},
                                            {MENU_BBK_GAMES_SPACE_TEXT,                 setting_child_3},
                                            {MAIN_MENU_BBK_SPACE_TEXT,                 setting_child_3},
                                            {MAIN_MENU_BBK_SPACE_TEXT,                 setting_child_3},
                                            };

#else

//extern const mmi_frm_hilite_hdlr_struct* mmi_frm_const_hilite_hdlr_table;
    
    MMI_ID_TYPE mm_stringIDs[MAX_MAIN_MENU_ITEMS];
    MMI_ID_TYPE mm_iconIDs[MAX_MAIN_MENU_ITEMS];

    U16 nMenuItemList[MAX_SUB_MENUS];
    S32 n_items;

    
    MMI_ID_TYPE mm_stringIDs2[MAX_MAIN_MENU_ITEMS];
    MMI_ID_TYPE mm_iconIDs2[MAX_MAIN_MENU_ITEMS];

    U16 nMenuItemList2[MAX_SUB_MENUS];
    S32 n_items2;


#endif

UI_string_type OUR_mmi_str[]={  L"Call History",
                                                L"Camera",
                                                L"BBK Room",
                                                L"Work&Study",
                                                L"My fav.",
                                                L"Game",
                                                L"Web",
                                                L"Messaging",
                                                L"Media",
                                                L"Ph. book",
                                                L"IM",
                                                L"Setting",
                                                L"OK",//12
                                                L"Back",//13
                                                };
///(void)

void DO_OUR_3D(int key);
void DO_OUR_3D_1(void);
int key_our=1;
//======================================
void DO_OUR_3D_LEFT()
{
    DO_OUR_3D(37);
    //key_our=37;
}
void DO_OUR_3D_RIGHT()
{
    DO_OUR_3D(39);
    //key_our=39;
}
void DO_OUR_3D_UP()
{
    DO_OUR_3D(38);
    //key_our=38;
}
void DO_OUR_3D_DOWN()
{
    DO_OUR_3D(40);
    //key_our=40;
}
void DO_OUR_3D_OK()
{
    DO_OUR_3D(97);
    //key_our=97;
}
void DO_OUR_3D_CANCEL()
{
    DO_OUR_3D(98);
    //key_our=98;
}
void DO_OUR_3D(int key)
{
    key_our=key;
    //gui_start_timer( 5, DO_OUR_3D_1);
    DO_OUR_3D_1();
}
color UI_COLOR_YELLOW = {0, 255, 255, 100};
void DO_OUR_3D_1(void)
{
    int t,tt;
    int ret=1;    
    s32 x,y,w,h;
    s32 i1,i2;
    stFontAttribute f={0};      
    //gui_cancel_timer(DO_OUR_3D_1);
    tt=drv_get_duration_ms(0);
    //draw the screem start=================
    while(1)
    {
        tt=drv_get_duration_ms(tt);
        //clear_screen_with_color(UI_COLOR_BLACK);
        //================================================
        ret=OUR_3D_Main( gdi_act_layer->buf_ptr,key_our, tt);
        key_our=0; //key must clear
        if(ret)         //is the engine stop
        {            
            {
                gui_BLT_double_buffer(0,0,UI_device_width-1,UI_device_height-1);//flash the lcd to put the frame out to user
            }
            //gui_start_timer( 1, DO_OUR_3D_1);
            //return;
        }
        else
        {
            break;  //the engine stoped
        }
    }
    //do the rest stuffs,font and key event======
    if(OUR_MMI_TOP== mmi_state.top_state)//get out of the 3d mmi
    {
        gui_BLT_double_buffer(0,0,UI_device_width-1,UI_device_height-1);
        GoBackHistory();
        return;
    }
    //===============================================================================    
    //this is in the first menu and we draw the words on====
    if(OUR_MMI_SUB== mmi_state.top_state)
    {  
        //f.size=LARGE_FONT;
        f.size=SMALL_FONT;
        gui_set_font(&f);
        gui_set_text_color(UI_COLOR_WHITE);//
        //gui_set_text_border_color(UI_COLOR_GREEN);
        for (i2=0; i2 <3; i2++)
        { 
            for (i1=0; i1 <2; i1++)
            {
#if 0                
                UI_string_type str_ptr;
                str_ptr=(UI_string_type)GetString(our_3d_mmi_2[bmp_inde[mmi_state.sub_state_line>>1][i2*2+i1]].str_id);
                gui_measure_string(str_ptr,&w,&h);
                gui_move_text_cursor((LCD_W/2-w)/2+i1*LCD_W/2,130+120*i2-h);
                gui_print_text(str_ptr);
#else 
                UI_string_type str_ptr;
                str_ptr=(UI_string_type)GetString(mm_stringIDs[bmp_inde[mmi_state.sub_state_line>>1][i2*2+i1]]);
                gui_measure_string(str_ptr,&w,&h);
                gui_move_text_cursor((LCD_W/2-w)/2+i1*LCD_W/2,110+120*i2*320/400-h);
                gui_print_text(str_ptr);
                
#endif
            }
        }
        //set zhe left softkey which is changed in the option mode
        SetKeyHandler(DO_OUR_3D_OK,     KEY_LSK,     KEY_EVENT_DOWN);   
        /*
        //draw the ok and back
        gui_set_text_color(UI_COLOR_BLACK);//
        f.size=MEDIUM_FONT;
        gui_set_font(&f);
        //ok
        gui_measure_string(OUR_mmi_str[12],&w,&h);
        gui_move_text_cursor(5,LCD_H-h+2);//
        gui_print_bordered_text(OUR_mmi_str[12]);  
        //back
        gui_measure_string(OUR_mmi_str[13],&w,&h);
        gui_move_text_cursor(LCD_W-w-5,LCD_H-h+2);//
        gui_print_bordered_text(OUR_mmi_str[13]);        
        */    
        ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
        ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
    }
    //=============================================================================    
    //this is in the second menu and we draw the words on====
    if(OUR_MMI_OPT== mmi_state.top_state)
    {      
        int start,end;
#if 0        
        gui_set_text_color(UI_COLOR_YELLOW);//
        f.size=LARGE_FONT;
        gui_set_font(&f);  
        i1=(((mmi_state.sub_state_line+1)&7)/2+mmi_state.sub_state_raw*4);
         if(i1>n_items)
        {
            i1=0;
        }
        gui_measure_string((UI_string_type)GetString(our_3d_mmi_2[i1].str_id),&w,&h);
        gui_move_text_cursor((LCD_W-w)/2,40-h);
        gui_print_text((UI_string_type)GetString(our_3d_mmi_2[i1].str_id));
                
        f.size=MEDIUM_FONT;
        gui_set_font(&f);
        gui_set_text_border_color(UI_COLOR_GREEN);

        our_3d_mmi_2[i1].third_menu[ mmi_state.opt_select].third_highlight_fun();
            
        SetKeyHandler(DO_OUR_3D_UP,     KEY_UP_ARROW,   KEY_EVENT_DOWN);
        SetKeyHandler(DO_OUR_3D_DOWN,KEY_DOWN_ARROW, KEY_EVENT_DOWN);
        
        SetKeyHandler(DO_OUR_3D_LEFT,   KEY_LEFT_ARROW,     KEY_EVENT_DOWN);
        SetKeyHandler(DO_OUR_3D_RIGHT, KEY_RIGHT_ARROW,    KEY_EVENT_DOWN);
        
        //SetKeyHandler(DO_OUR_3D_OK,     KEY_LSK,     KEY_EVENT_DOWN);
        SetKeyHandler(DO_OUR_3D_CANCEL,KEY_RSK,KEY_EVENT_DOWN);
        
        for (i2=0; i2 <6; i2++)
        {             
                UI_string_type str_ptr;
                U16 sid;
                sid = our_3d_mmi_2[i1].third_menu[i2].str_id;
                str_ptr=(UI_string_type)GetString(sid);
                gui_measure_string(str_ptr,&w,&h);
                gui_move_text_cursor(30,65+40*i2-h);//
                gui_print_text(str_ptr);
               // gui_measure_string(OUR_mmi_str[i2],&w,&h);
               // gui_move_text_cursor(50,95+50*i2-h);//
               // gui_print_text(OUR_mmi_str[i2]);
                      
        }  
#else
        gui_set_text_color(UI_COLOR_YELLOW);//
        f.size=LARGE_FONT;
        gui_set_font(&f);  
        i1=(((mmi_state.sub_state_line+1)&7)/2+mmi_state.sub_state_raw*4);
        if(i1>n_items)
        {
            i1=0;
        }
        gui_measure_string((UI_string_type)GetString(mm_stringIDs[i1]),&w,&h);
        gui_move_text_cursor((LCD_W-w)/2,30-h);
        gui_print_text((UI_string_type)GetString(mm_stringIDs[i1]));
                
        


    n_items2 = GetNumOfChild_Ext(nMenuItemList[i1]);
    GetSequenceStringIds_Ext(nMenuItemList[i1], mm_stringIDs2);
    GetSequenceImageIds_Ext(nMenuItemList[i1], mm_iconIDs2);
    //SetParentHandler(IDLE_SCREEN_MENU_ID);
    //attributes = GetDispAttributeOfItem(IDLE_SCREEN_MENU_ID);
    GetSequenceItemIds(nMenuItemList[i1], nMenuItemList2);
    
       // ExecuteCurrHiliteHandler_Ext(nMenuItemList2[mmi_state.opt_select]);
            mmi_frm_get_hilite_hdlr(nMenuItemList2[mmi_state.opt_select])();

       
        SetKeyHandler(DO_OUR_3D_UP,     KEY_UP_ARROW,   KEY_EVENT_DOWN);
        SetKeyHandler(DO_OUR_3D_DOWN,KEY_DOWN_ARROW, KEY_EVENT_DOWN);
        
        SetKeyHandler(DO_OUR_3D_LEFT,   KEY_LEFT_ARROW,     KEY_EVENT_DOWN);
        SetKeyHandler(DO_OUR_3D_RIGHT, KEY_RIGHT_ARROW,    KEY_EVENT_DOWN);
        
        //SetKeyHandler(DO_OUR_3D_OK,     KEY_LSK,     KEY_EVENT_DOWN);
        SetKeyHandler(DO_OUR_3D_CANCEL,KEY_RSK,KEY_EVENT_DOWN);

        mmi_state.opt_select_max=n_items2;
        
        start=(mmi_state.opt_select/6)*6;
        end=mmi_state.opt_select_max-start;
            
        if(end>6)
        {
            end=6;
        }
        f.size=MEDIUM_FONT;
        gui_set_font(&f);
        gui_set_text_color(UI_COLOR_YELLOW);//
        //gui_set_text_border_color(UI_COLOR_GREEN);

        //our_3d_mmi_2[i1].third_menu[ mmi_state.opt_select].third_highlight_fun();
        for (i2=0; i2 <end; i2++)
        {             
                UI_string_type str_ptr;
                U16 sid;
                sid = mm_stringIDs2[i2+start];
                str_ptr=(UI_string_type)GetString(sid);
                gui_measure_string(str_ptr,&w,&h);
                gui_move_text_cursor(30,70+40*i2-h);//
                gui_print_text(str_ptr);
                
               // gui_measure_string(OUR_mmi_str[i2],&w,&h);
               // gui_move_text_cursor(50,95+50*i2-h);//
               // gui_print_text(OUR_mmi_str[i2]);
                      
        }  
#endif
    }
    //=======================================================================================
    
    gui_BLT_double_buffer(0,0,UI_device_width-1,UI_device_height-1);   
    /**/
}

U8 back_from_history_3d=0;

void EntryMySetting1_exit(void)
{
    back_from_history_3d=1;
}


void EntryMySetting2(void)
{
    int*my_frame;
    s32 i;
    EntryNewScreen(MAIN_MENU_SCREENID,EntryMySetting1_exit,EntryMySetting2,NULL);
    entry_full_screen();
    //=================================  
    
    ////=================================
    //gui_BLT_double_buffer(0,0,UI_device_width-1,UI_device_height-1);

    
    SetKeyHandler(DO_OUR_3D_UP,     KEY_UP_ARROW,   KEY_EVENT_DOWN);
    SetKeyHandler(DO_OUR_3D_DOWN,KEY_DOWN_ARROW, KEY_EVENT_DOWN);
    
    SetKeyHandler(DO_OUR_3D_LEFT,   KEY_LEFT_ARROW,     KEY_EVENT_DOWN);
    SetKeyHandler(DO_OUR_3D_RIGHT, KEY_RIGHT_ARROW,    KEY_EVENT_DOWN);
    
    SetKeyHandler(DO_OUR_3D_OK,     KEY_LSK,     KEY_EVENT_DOWN);
    SetKeyHandler(DO_OUR_3D_CANCEL,KEY_RSK,KEY_EVENT_DOWN);
    SetKeyHandler(GoBackHistory,        KEY_2,    KEY_EVENT_DOWN); 


//=================================   
    

    DO_OUR_3D_OK();
    //DO_OUR_3D_1();
}

void EntryMySetting1(void)
{
    OUR_3D_Init();
    

    n_items = GetNumOfChild_Ext(IDLE_SCREEN_MENU_ID);
    GetSequenceStringIds_Ext(IDLE_SCREEN_MENU_ID, mm_stringIDs);
    GetSequenceImageIds_Ext(IDLE_SCREEN_MENU_ID, mm_iconIDs);
    //SetParentHandler(IDLE_SCREEN_MENU_ID);
    //attributes = GetDispAttributeOfItem(IDLE_SCREEN_MENU_ID);
    GetSequenceItemIds(IDLE_SCREEN_MENU_ID, nMenuItemList);
    
    EntryMySetting2();
}

#endif //our_3d






#if 0
//
//
//
//
#endif
//#endif
